package huhx.linux.com.kotlinlearn.http

import android.content.Context
import android.widget.Toast

import io.reactivex.functions.Consumer

/**
 * Created by huhx on 2018-03-17 下午 8:23.
 */

abstract class ErrorConsumer internal constructor(private val context: Context) : Consumer<Throwable> {

    @Throws(Exception::class)
    override fun accept(throwable: Throwable) {
        Toast.makeText(context, throwable.message, Toast.LENGTH_SHORT).show()
    }
}
